home *** CD-ROM | disk | FTP | other *** search
/ Best of Shareware / Best of PC Windows Shareware 1.0 - Wayzata Technology (7111) (1993).iso / mac / DOS / CAD_CAM / LASI42 / LASIDSS.TXT < prev    next >
Text File  |  1993-09-20  |  15KB  |  433 lines

  1.  
  2.  
  3.               LASI Data Structure Standard for Version 4.2
  4.  
  5.   The following information is supplied for use by anyone who may want to
  6.   access the data structure of LASI drawings. LASI data files have two
  7.   representations, internal and external. The information regarding
  8.   internal data files is subject to change, and, be warned, any programs
  9.   using it may need to be modified in the future. External (TLC) format
  10.   will remain consistent, or at most a conversion program will be supplied
  11.   if modifications are made.
  12.  
  13.   Internal data files are optimized for fast access and are used by the
  14.   program itself as it executes. The form of these files is given below.
  15.  
  16.   Utilities may be written to operate on these files, but it may be
  17.   somewhat more difficult due to the cell pointers used internally.
  18.  
  19.   External (TLC) files are ASCII files that contain cell references by
  20.   name not pointer and data for objects in readable (and editable) ASCII.
  21.   Transfer of cells between drawings can be more easily accomplished and
  22.   utility programs can be mpre easily written when the external form is
  23.   used.
  24.  
  25.   Internal form will first be described, then external.
  26.  
  27.  
  28.   Notes:
  29.  
  30.     1. In records, separator characters will be shown in < >.
  31.        <nl>= newline (<cr><lf>)
  32.        <sp>= space
  33.  
  34.     2. Basic Units are the smallest unit of the 16-bit integers in which a
  35.        drawing is maintained in the LASI data. Physical Units are the
  36.        units in which you do a layout drawing (mil, um, etc.) These are
  37.        related to the basic units by the Scale Factor.
  38.  
  39.     3. Version numbers may contain alpha characters but the number must
  40.        always begin with a numeric character.
  41.  
  42.  
  43.  
  44.   1.0 Basic Drawing Files:
  45.  
  46.   A drawing consists of Drawing Basic Data files (.DBD) and a number of
  47.   cell files (.BP4 and .CL4 files internally, or .TLC files externally).
  48.   The DBD files are the CELLS4.DBD, CONSTS4.DBD and FORM.DBD files. These
  49.   are ASCII sequential files. CELLS4.DBD contains the information
  50.   regarding the cells associated with a drawing. CONSTS4.DBD contains the
  51.   preserved constants that set up a drawing, i.e. window sizes, scales,
  52.   etc. FORM.DBD contains permanent setup information for a drawing.
  53.  
  54.   There is also a TXT.DBD file that is binary and contains the text font
  55.   patterns. This has to be edited using the MAKETXT.EXE program.
  56.  
  57.  
  58.   1.1  CELLS4.DBD file:
  59.  
  60.   This is an ASCII sequential file consisting of the number of cells
  61.   followed by 10-entry records for each cell.
  62.  
  63.  
  64.   File Format:
  65.  
  66.   Number of Cells<nl>
  67.  
  68.   Cell 1 Record:
  69.       Entry:
  70.           1= Name of cell<nl>
  71.           2= Rank of cell (1-15)<sp> (see below)
  72.           3= Left boundary of cell in basic units<sp>
  73.           4= Bottom boundary of cell in basic units<sp>
  74.           5= Right boundary of cell in basic units<sp>
  75.           6= Top boundary of cell in basic units<sp>
  76.           7= Number of boxes in cell<sp>
  77.           8= Number of poly in cell<sp>
  78.           9= Number of vertices in cell<sp>
  79.           10= Number of cells in cell<nl>
  80.  
  81.   Cell 2 Record: etc.,etc.,
  82.  
  83.   Notes:
  84.  
  85.     1. Cells may be in any order. A cell with rank other than 1-15 is
  86.        uneditable.
  87.  
  88.     2. Pooled cells are marked with the 256-bit (100 hex) set to 1. Since
  89.        pooled cells may have only a rank of 1, this number will always be
  90.        257 for a pooled cell.
  91.  
  92.  
  93.   1.2 CONSTS4.DBD File:
  94.  
  95.   The CONSTS4.DBD file is a nonessential file; if absent, it defaults to a
  96.   standard configuration when the LASI program is started. When LASI is
  97.   closed, a CONSTS4.DBD with the present configuration is written.
  98.  
  99.   It is possible for future versions of LASI to have different CONSTS4.DBD
  100.   files, that is, compatibility is not guaranteed. In such case, deleting
  101.   an old CONSTS4.DBD file and defaulting to the standard configuration at
  102.   first will be necessary.
  103.  
  104.   It is expected that the first 3 entries (the version, the scale factor,
  105.   and the physical units) will be unchanged, since they provide
  106.   information to conversion utilities.
  107.  
  108.   File Format:
  109.  
  110.   The present CONSTS4.DBD file contains the following sequential ASCII
  111.   data readable by a BASIC INPUT or a C scanf() function:
  112.  
  113.       The Version of LASI under which the file was made
  114.       The Number of Basic Units per Physical Unit
  115.       The Name of the Physical Unit
  116.       A 64 character Color String with each character indicating the color
  117.       of the layer (r=red etc.)
  118.       64 FILL numbers indicating which fills are to be used on the
  119.       corresponding layer.
  120.       64 DASH numbers indicating which dashes are to be used on the
  121.       corresponding layer.
  122.       The Number of Working Grids
  123.       All 10 Working Grids in basic units
  124.       The Maximum Number of Ranks
  125.       For 15 Cell Mode Ranks, the Working Grid Number, the Dot Grid,
  126.       The Grid Visibility Flag, and the Window Width, the Window
  127.       Center X and Y Positions, in basic units
  128.  
  129.   Integer Constants:
  130.       Layer Number for ADD
  131.       Drawing Resolution Limit Number
  132.       Number of Arc Segments
  133.       Default Path Width
  134.       Octo Flag
  135.       Path Center Line Flag
  136.       Double Click Ticks
  137.       Sort Backup Time
  138.       Text Reference Flag
  139.       Text Layer for ADD
  140.       Default Text Width
  141.       Fill with 0 to 16 entries
  142.  
  143.   Float Constants:
  144.       The Maximum Number of Saved Windows (9)
  145.       All Saved Window Widths, X Centers and Y Centers
  146.       Text Spacing Ratio
  147.       PSIZ Number
  148.       Rotation Angle
  149.       OVSZ Distance
  150.       R Sheet Resistance
  151.       C per Square
  152.       R End Correction
  153.       Fill with 0 to 16 entries
  154.  
  155.   String Constants:
  156.       Kind of Object to be ADDed ("B","P", or Name of Cell)
  157.       VIEW Layers
  158.       OPEN Layers
  159.       DASH Layers
  160.       Arc Add Direction (cw, ccw)
  161.       Fill with "reserved" to 8 entries
  162.       "end"   (end marker for short read check)
  163.  
  164.  
  165.  
  166.   2.0  Cell Data Files
  167.  
  168.   There are two kinds of Cell Data Files BP4 files and CL4 files. BP4
  169.   files contain the boxes, poly and vertices of a cell. CL4 files contain
  170.   the cells within the cell. All cells have BP4 files, but only if a
  171.   cell's rank > 1 will it have a CL4  file.
  172.  
  173.   All data files are binary files. Each block of data records is read
  174.   until a zero is encountered in the first record entry. The box data
  175.   records are placed first in a BP4 file, followed by the path data
  176.   records, and finally by the vertex data records. This data structure
  177.   allows any unknown cell file to be read into the drawing system without
  178.   prior knowledge of the number or type of records.
  179.  
  180.  
  181.   2.1  Box Data Structure
  182.  
  183.   Box data is kept in an array of structures with 5 integer members.
  184.  
  185.       Box Record Entries:
  186.  
  187.       0 = Bits 0-7 , Layer Number (1-64)
  188.           Bits 8-11 , Active Side Program Flags (Cleared in File)
  189.           Bits 12-13 , Unused Flags (Cleared in File)
  190.           Bit 14, Program Out of Window Flag (Cleared in File)
  191.           Bit 15, Unused (Cleared in File)
  192.  
  193.                         active side
  194.                           | | | |
  195.                   x x x x|x x x x|x x x x|x x x x
  196.                     |             | | | | | | | |
  197.                     owb           <--- layer --->
  198.            (out of window bit)
  199.  
  200.       1= Lower Left Corner X Position in basic units
  201.  
  202.       2= Lower Left Corner Y Position
  203.  
  204.       3= Upper Right Corner X Position
  205.  
  206.       4= Upper Right Corner Y Position
  207.  
  208.  
  209.  
  210.   2.2  Path Data Structure:
  211.  
  212.   Path data is kept in an array of structures with 3 integer members.
  213.  
  214.   A variation in the normal path data structure is used in Vers 4 to store
  215.   path entities that expand as written text. The path record contains a
  216.   marker bit and orientation bits. The first vertex record is a normal
  217.   vertex record which locates the text in the drawing, however, the
  218.   subsequent records contain ASCII character codes as explained below.
  219.  
  220.   Path Record Entries:
  221.  
  222.       0 = Bits 0-7, Layer of Path (1-64)
  223.           Bit 8, Path has 1 or more Active Vertices Flag (Cleared in
  224.           File)
  225.  
  226.           Bits 9-15,
  227.  
  228.           If Normal Path:
  229.               Program Flags (Cleared in File)
  230.  
  231.           else if Path Text:
  232.               Bits 9-11, Orientation Bits (same as Cells)
  233.               Bit 15 set indicates Path Text Record
  234.  
  235.                      0x3800     0x100
  236.                       oren     active
  237.                       | | |     |
  238.                   x x x x|x x x x|x x x x|x x x x
  239.                   | |       | |   | | | | | | | |
  240.                   | owb     nop   <--- layer --->
  241.                   text                0xFF
  242.  
  243.       1= If Normal Path:
  244.           Width of Path in basic units (0 indicates Poly)
  245.  
  246.       else if Path Text:
  247.           Size of Path Text (size of character field)
  248.  
  249.       2= Pointer to First Vertex of path in vertex array
  250.  
  251.  
  252.   2.3  Vertex Data Structure:
  253.  
  254.   Vertex data is kept in a array of structures with 4 integer members.
  255.  
  256.   Vertex Record Entries:
  257.  
  258.       0 = Bits 0-12, Number of Path to which Vertex belongs
  259.           Bit 13, Active Vertex Bit (Cleared in File)
  260.           Bits 14-15,
  261.  
  262.           If Normal Paths:
  263.               Program Flags (Cleared in File)
  264.           else if Path Text:
  265.               Bit 15 set indicates Path Text Character Record
  266.  
  267.  
  268.                  0x4000
  269.                  active
  270.                     |
  271.                   x x x x|x x x x|x x x x|x x x x
  272.                   |   | | | | | | | | | | | | | |
  273.                   |    <----- path number ----->
  274.                   text vtx       0x3FFF
  275.                   0x8000
  276.  
  277.       1= If Normal Path:
  278.           X Position of Vertex in basic units
  279.  
  280.       else if Path Text:
  281.           Two bytes ASCII Character Code
  282.  
  283.       2= If Normal Path:
  284.           Y Position of Vertex in basic units
  285.  
  286.       else if Path Text:
  287.           Two bytes ASCII Character Code
  288.  
  289.       3= Pointer to next Vertex in Vertex Array
  290.           (Zero for the Last Vertex of a Path)
  291.  
  292.  
  293.   2.4  Cell Data Structure:
  294.  
  295.   Cell data is kept in a 2-dimensional array of structures of 3 integer
  296.   members. The added dimension is the depth of cell nesting, so that a
  297.   parent cell remans loaded while lesser cells are load and drawn. In a
  298.   CL4 file the nesting level is unnecessary, and the data is kept in a
  299.   binary file following the same rules as the BP4 file but with the .CL4
  300.   file extension.
  301.  
  302.   Cell Record Entries:
  303.  
  304.       0 = Bits 0-9, Number of cell in CELLS4.DBD list
  305.           Bit 10, Active Cell Flag (Cleared in File)
  306.           Bits 11-13, Orientation (See Below)
  307.           Bit 14, Draw Outline Flag
  308.           Bit 15, Extended Flag (reserved)
  309.  
  310.                  outl orien active
  311.                     | | | | |
  312.                   x x x x|x x x x|x x x x|x x x x
  313.                   |           | | | | | | | | | |
  314.                   |           <--- ref number -->
  315.           (reserved extended)
  316.  
  317.       1= X Position of Cell in basic units
  318.  
  319.       2= Y Position of Cell in basic units
  320.  
  321.       Orientation:
  322.           Bit 13, Cell is flipped in Y and then rotated
  323.           Bits 12 and 11,
  324.           0= no rotation
  325.           1= 90 deg ccw rotation
  326.           2= 180 deg ccw rotation
  327.           3= 270 deg ccw rotation
  328.  
  329.  
  330.   3.0 External Data Files:
  331.  
  332.   The external data file representation condenses the CELLS4.DBD, BP4 and
  333.   CL4 files into one representation, thus making cells transportable. The
  334.   files have the extension .TLC (Transportable LASI Cell). The same
  335.   terminators are used as above so that TLC files can be read by BASIC or
  336.   C.
  337.  
  338.   Each Cell has its own TLC file. This means that a TLC file may not
  339.   really contain all the information to construct a cell if it has lesser
  340.   cells within it. In that case, the TLC files for the lesser cells will
  341.   have to be present for conversion to internal form. When converting to
  342.   external form, the program TLC.EXE automatically makes the TLC files for
  343.   lesser cells if they are not present in the MS-DOS directory. When
  344.   conversion from external to internal is being done, the lesser cells are
  345.   also made in internal form  by the TLC conversion program if not already
  346.   present.
  347.  
  348.   The following records may be in ANY ORDER in a TLC file.
  349.  
  350.   Records in Detail
  351.  
  352.     Header Record:      <nl>= carriage return + linefeed    <sp>= space
  353.  
  354.         1= "=H" (literal)<nl>
  355.         2= Name of Cell (DOS file name)<nl>
  356.         3= Version of LASI (literal)<nl>
  357.         4= Version of TLC (literal)<nl>
  358.         5= Basic Units per Physical Unit<nl>
  359.         6= Name of Physical Unit (literal)<nl>
  360.         7= Date of Cell Conversion (literal)<nl>
  361.         8= Time of Cell Conversion (literal)<nl>
  362.         9= Rank of Cell<sp>
  363.         10= Left Outline Boundary in basic units<sp>
  364.         11= Bottom Boundary in basic units<sp>
  365.         12= Right Boundary in basic units<sp>
  366.         13= Top Boundary in basic units<nl>
  367.         14= Number of Boxes<sp>
  368.         15= Number of Paths<sp>
  369.         16= Number of Vertices<sp>
  370.         17= Number of Cells<nl>
  371.  
  372.         Note:  Versions must begin with a numeric character
  373.  
  374.     Cell Record Entries:
  375.  
  376.         1= "=C" (literal)<nl>
  377.         2= Name of Lesser Cell<nl>
  378.         3= Orientation (see below)<sp>
  379.         4= X Position in basic units<sp>
  380.         5= Y Position in basic units<sp>
  381.         6= reserved (presently zero)<nl>
  382.  
  383.         Property Number: (0-15)
  384.           16 bit integer, all bits 0 except:
  385.  
  386.             Bit 4,
  387.               0= draw cell fully
  388.               1= draw cell outline
  389.  
  390.           Orientation:
  391.             Bit 3,
  392.               0= cell not flipped
  393.               1= cell is flipped in Y before rotation
  394.  
  395.             Bits 2 and 1,
  396.               0,0 = no rotation
  397.               0,1 = 90 deg rotation CCW
  398.               1,0 = 180 deg rotation CCW
  399.               1,1 = 270 deg rotation CCW
  400.  
  401.     Box Record Entries:
  402.  
  403.         1= "=B" (literal)<nl>
  404.         2= Layer of Box<sp>
  405.         3= X of Lower Left Corner in basic units<sp>
  406.         4= Y of Lower Left Corner in basic units<sp>
  407.         5= X of Upper Right Corner in basic units<sp>
  408.         6= Y of Upper Right Corner in basic units<nl>
  409.  
  410.     Path/Poly Record Entries:
  411.  
  412.         1= "=P" (literal)<nl>
  413.         2= Layer of Path/Poly<sp>
  414.         3= Width in basic units<sp>
  415.         4= No. of Vertices in path/poly<nl>
  416.         5= Vertices in basic units in the form:
  417.         X1<sp>Y1<sp>X2<sp>Y2<sp>X3<sp>Y3<sp>X4<sp>Y4<sp>X5<sp>Y5<nl>
  418.         .......Xn-1<sp>Yn-1<sp>Xn<sp>Yn<nl>
  419.  
  420.         (Groups of 5 coordinates separated by <sp> ended by <nl>,
  421.         always with <nl> after Last Coordinate Pair)
  422.  
  423.     Text Record Entries:
  424.  
  425.         1= "=T" (literal)<nl>
  426.         2= Layer of Text<sp>
  427.         3= Size in basic units<sp>
  428.         4= No. of Vertices used by text (includes Ref Point)<sp>
  429.         5= Orientation 0-7 (same as cells)<nl>
  430.         6= X Ref Point in basic units<sp>
  431.         7= Y Ref Point in basic units<nl>
  432.         8= ASCII character text string<nl> (u/l case, up to 40 characters)
  433.